<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
	<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
	<div style="padding-left:70px;padding-bottom:5px;padding-top: 25px;">
	    <table style="table-layout:fixed;">
	    	<tr>
	           	<td style="width: 200px;">
	           		<input id="file_upload" name="file_upload" type="file" >
	           	</td>
	        </tr>
	    </table>
	</div>
	<div style="text-align:center;padding:20px;margin-top: 20px;">               
	    <a class="mini-button" onclick="onOk" style="width:60px;margin-right:50px;">导入</a>       
	    <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>       
	</div>        
</body>
</html>

<script type="text/javascript">
	mini.parse();

    $(function(){
    	setTimeout(function(){
	    	$('#file_upload').uploadify({
	    		'auto':false,
	    		'swf':'scripts/uploadify/uploadify.swf',
	    		'uploader':'call_allocate_import_save.do;jsessionid=<%=session.getId()%>',
	    		'fileSizeLimit':'5MB',
	    		'fileTypeExts':'*.xls',
	    		'fileTypeDesc':'xls',
	    		'buttonText':'选择文件',
	    		'queueSizeLimit':1,
	    		'onUploadSuccess':function(file, data, response){
	    			data = eval('(' + data + ')');
	    			if(data.success){
		    			window.CloseOwnerWindow("succ");
	    			}else{
	    				mini.alert("导入失败");
	    			}
	    		}
	    	});
    	}, 5);
    });
    
    function onOk(e) {
    	$("#file_upload").uploadify('upload', '*');
    }
    
    function onCancel(e) {
    	window.CloseOwnerWindow("cancel");
    }
</script>